package com.slz3.business.module.systemManagement.sysOrganize.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysOrganize.domain.SysOrganize;
import com.slz3.business.module.systemManagement.sysOrganize.domain.SysOrganizeCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysOrganizeResAtomic {

    static Mono<ServerResponse> add_$SysOrganizeUpdateLock(ServerRequest req, SysOrganize sysOrganize) {
        return SysOrganizeResSafeValid.add(req, sysOrganize) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.add(req, sysOrganize);
    }

    public static Mono<ServerResponse> delete_$SysOrganizeUpdateLock(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        return SysOrganizeResSafeValid.delete(req, sysOrganizeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$SysOrganizeUpdateLock(ServerRequest req, SysOrganize sysOrganize) {
        return SysOrganizeResSafeValid.modify(req, sysOrganize) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.modify(req, sysOrganize);
    }

    static Mono<ServerResponse> info_$SysOrganizeUpdateLock(ServerRequest req) {
        return SysOrganizeResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$SysOrganizeUpdateLock(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        return SysOrganizeResSafeValid.auditSubmit(req, sysOrganizeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$SysOrganizeUpdateLock(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        return SysOrganizeResSafeValid.audit(req, sysOrganizeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$SysOrganizeUpdateLock(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        return SysOrganizeResSafeValid.auditReject(req, sysOrganizeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$SysOrganizeUpdateLock(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        return SysOrganizeResSafeValid.usingEnable(req, sysOrganizeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$SysOrganizeUpdateLock(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        return SysOrganizeResSafeValid.usingDisable(req, sysOrganizeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysOrganizeResExecutor.usingDisable(req);
    }
}
